import * as vscode from 'vscode';
import * as Fs from 'fs';
import * as Path from 'path';
export function mkdirsSync(filepath: string) {
  const rootPath = vscode.workspace.rootPath || '';
  const arr = filepath.split('/');
  let dir = arr[1];
  const path = Path.join(rootPath, '/' + dir);
  for (let i = 1; i < arr.length + 1; i++) {
    if (Fs.existsSync(path)) {
      return true;
    } else {
      if (mkdirsSync(Path.dirname(path))) {
        Fs.mkdirSync(path);
        return true;
      }
    }
  }
}
